import request from '@/utils/request'

// 修改库位
export const setLocation = data => request.put('/api/location', data)

// 分页查询库位
export const getLocationList = params => request.get('/api/location/page', { params })

// 分页查询库位详细信息
export const getLocationDetailsList = params => request.get('/api/location/pageDetail', { params })

// 删除库位
export const delLocation = params => request.delete('/api/location', { params })

// 新增库位
export const addLocation = data => request.post('/api/location', data)

// 查询全部库位
export const getAllLocationList = params => request.get('/api/location/list', { params })

// 查询全部库位详细信息
export const getAllLocationDetailsList = params => request.get('/api/location/listDetail', { params })

// 查询库位
export const queryLocation = id => request.get(`/api/location/${id}`)

// 导入
export const locationImportExcel = data => request({
  method: 'POST',
  url: '/api/location/upload',
  data,
  headers: { 'content-type': 'multipart/form-data' }
})

// 下载
export const downloadLocation = () => request({
  url: '/template/locationTemplate.xlsx',
  responseType: 'blob'
})

